package com.woniu.controller;


import com.woniu.commons.model.Result;
import com.woniu.model.form.AddCoachEnterVanueForm;
import com.woniu.service.YCoachEnterVenueService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author EdisonLiu
 * @since 2024年05月23日
 */
@RestController
@RequestMapping("/yCoachEnterVenue")
@Api(tags = "教练入驻场馆接口")
public class YCoachEnterVenueController {

    @Resource
    private YCoachEnterVenueService coachEnterVenueService;

    /**
     * 新增场馆教练绑定关系
     * @param form 场馆id和教练id
     * @return
     */
    @GetMapping("/addCoachEnterVanue")
    public Result<?> addCoachEnterVanue(AddCoachEnterVanueForm form){
        Integer i = coachEnterVenueService.addCoachEnterVanue(form);
        if (!i.equals(1)){
            return Result.getResult().setMsg("添加失败").setCode(500);
        }
        return Result.getResult().setMsg("添加成功");
    }



}

